package com.wfs.myapp.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegExUtil {

    public static String desensitizePhone(String phone) {
        Pattern pattern = Pattern.compile("(\\d{3})\\d{4}(\\d{4})");
        Matcher matcher = pattern.matcher(phone);
        if (matcher.find()) {
            return matcher.replaceAll("$1****$2");
        }
        return "";
    }
}
